API Interfaces
API interfaces are self documenting. The descriptions below are taken from the online documentation and might be out of date. Refer to the following links for live documentation:
- DropDownValues API (https://GramChain-test.littlebit.sg/API/DropDownValues//)
- Public API (https://GramChain-test.littlebit.sg/API/public/ ).
- Secured API (https://GramChain-test.littlebit.sg/API/secured/)
Secured API Overview (see API Link for latest Specification)
These APIs handle sensitive processes or write or read to the GramChain requiring additional security and separation from public APIs. Note that there are separate writing APIs for scanner (for vault personnel) and for Web Interfaces (Admin, locks).
The GramChain API requires the following default parameters:
languageid = this field is a two-character support for simple multi-language. Default value is 'en' for English, 'cn' for Chinese.
entityid = a field which allows for different results to be returned based on caller entity, (e.g. Cache, P2P, scanner) for scanner entries use empty string '' as default.
callerid = the userID calling this API (if known). This allows for traceability of data access (required for scanner) but is not a required for public calls and can be left black.
DropDownValues API Overview (see API Link for latest Specification)
DropDownValue APIs return allowed values for GramChain code fields. These are used to populate dropdowns and can be filtered based on entityid. Typically these values should be called once and cached locally by scanners on startup as their data rarely change.
The blockchain hash used to verify GramChain integrity hashes legible codes (values), not the names or description associated with the codes. For example, the international common code 'AU' is used as a MetalCode code to codify the more common Name/Description 'Gold'. An advantage of this system is that the codes provide transparency (AU) while also allowing the code to be mapped to multiple languages for multi-language support.
The DropDownValues API requires the following parameters:
languageid = this field is a two-character support for simple multi-language. Default value is 'en' for English, 'cn' for Chinese.
entityid = a field which allows for different results to be returned based on caller entity, (e.g. Cache, P2P, scanner) for scanner entries use empty string '' as default.
callerid = the userID calling this API (if known). This allows for traceability of data access (required for scanner) but is not a required for public calls and can be left black.
app = the calling app code. This filters events and other dropdown values based on the app. For vault scanners use 'scan' for P2P use 'p2p' for cache use 'cache'
Public API Overview (see API Link for latest Specification)
These are public APIs that will be called most often and require good scalability.
The API requires the following default parameters:
languageid = this field is a two-character support for simple multi-language. Default value is 'en' for English, 'cn' for Chinese.
entityid = a field which allows for different results to be returned based on caller entity, (e.g. Cache, P2P, scanner) for scanner entries use empty string '' as default.
callerid = the userID calling this API (if known). This allows for traceability of data access (required for scanner) but is not a required for public calls and can be left black.